﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.Controllers.BackEnd;
using System.Web.Mvc;
using Proggy.Data.Abstract;

namespace Proggy.Web.Cms.Core.Controllers.PropertyType
{
    public class UrlSelectorController: BackEndControllerBase
    {
        public UrlSelectorController(INodeRepository repo) {
            this._repo = repo;
        }
        private INodeRepository _repo;
        public ActionResult SelectedContent(int? nodeId) {
            // check
            if (nodeId == null)
            {
                return Content("No content yet selected");
            }
            
            // get node repo
            var nodeRepo = _repo;// DependencyResolver.Current.GetService<INodeRepository>();

            // get node
            var node = nodeRepo.GetPublishableNodeFromNodeId((int)nodeId);

            //
            return PartialView(node);
        }

        public PartialViewResult UrlSelector(int? selected, string pickerId) {

            return PartialView();

        }
    }
}
